home *** CD-ROM | disk | FTP | other *** search
- Path: cs.umd.edu!gilman
- From: gilman@cfar.umd.edu (Gil Carmel)
- Newsgroups: comp.lang.c++
- Subject: Template Class Linkage?
- Date: 6 Jan 1996 20:55:24 GMT
- Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
- Message-ID: <4cmnjs$mk7@mimsy.cs.umd.edu>
- NNTP-Posting-Host: scribble.cfar.umd.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Hi,
-
- I'm just learning templates, and I'm having problems with linkage.
- When the template class member function bodies are included in the ".h" file,
- everything is fine. But when the function bodies are in a separate ".c" file,
- calls to these functions from other files give an "undefined reference to
- function" error from the linker. Do template class member functions have
- to be in the ".h" file, or is this a problem with my compiler?
-
- Thanks for any help,
- Gil
-
- --
- |-----------------------------------------------------------|
- | Gil Carmel | gilman@wam.umd.edu |
- | Computer Science Undergraduate | gilman@cfar.umd.edu |
- | University of Maryland | |
- | College Park, MD | |
- |-----------------------------------------------------------|
- | | \o | |
- | | |\ | |
- | | / \ | |
-